﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Demo.Services.Contracts.DTO.Infos.AreaInfo>" %>

<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Nueva Area</title>    
    <style type="text/css">
        h1 {
            font: normal 60px tahoma, arial, verdana;
            color: #E1E1E1;
        }
        
        h2 {
            font: normal 20px tahoma, arial, verdana;
            color: #E1E1E1;
        }
        
        h2 a {
            text-decoration: none;
            color: #E1E1E1;
        }
        
        .x-window-mc {
            background-color : #F4F4F4 !important;
        }
    </style>
    <script type="text/javascript">
        /*if (window.top.frames.length !== 0) {
            window.top.location = self.document.location;
        }*/
    </script>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager" runat="server" />
    
    <h1>Area</h1>    
    <ext:Window 
        ID="NewArea"
        runat="server" 
        Closable="false"
        Resizable="false"
        Height="130" 
        Icon="Lock" 
        Title="Area"
        Draggable="true"
        Width="300"
        Modal="true"
        Layout="fit"
        Padding="5">        
        <Items>
                <ext:FormPanel ID="FormPanel1" 
                    runat="server" 
                    FormID="form1"
                    Border="false"
                    Layout="form"                     
                    BodyStyle="background:transparent;" 
                    Url='<%# Html.AttributeEncode(Url.Action("Create")) %>'>
                    <Items>                        
                         <ext:TextField 
                            ID="txtDescripcion" 
                            runat="server" 
                            InputType="Text" 
                            FieldLabel="Descripciòn" 
                            AllowBlank="false" 
                            BlankText="Descripciòn Requerida."
                            Text=""
                            AnchorHorizontal="100%"
                            />
                    </Items>
                </ext:FormPanel>
        </Items>
        <Buttons>
            <ext:Button ID="Button1" runat="server" Text="Guardar" Icon="Accept">
                <DirectEvents>
                    <Click 
                        Url="/Area/Create/"                        
                        CleanRequest="true" 
                        Method="POST"
                        Before="Ext.Msg.wait('Guardando', 'Area');"
                        Failure="Ext.Msg.show({
                           title:   'Error al guardar',
                           msg:     result.errorMessage,
                           buttons: Ext.Msg.OK,
                           icon:    Ext.MessageBox.ERROR
                        });"                        
                        Success="Ext.Msg.show({
                           title:   'Area',
                           msg:     'Se guardo exitosamente',
                           buttons: Ext.Msg.OK,
                           icon:    Ext.MessageBox.OK
                        });"
                        >
                        <EventMask MinDelay="250" />                
                        <ExtraParams>
                            <ext:Parameter Name="descripcion" Value="#{txtDescripcion}.getValue()" Mode="Raw"/>
                        </ExtraParams>
                    </Click>
                </DirectEvents>
            </ext:Button>
        </Buttons>
    </ext:Window>
</body>
</html>
